import java.util.Random;
import java.util.Scanner;

public class Guessnumber {
    public static void main(String[] args) {

        Random rand = new Random();
        int r = rand.nextInt(1000) + 1;
        System.out.println(r);
        Scanner s = new Scanner(System.in);
        System.out.println("请猜数字（0-1000）:");
        for (int i = 0; i < 10; i++) {
            int number = s.nextInt();
            if (number < r) {
                System.out.println("太小了，再大一点！");
            } else if (number > r) {
                System.out.println("太大了，再小一点！");
            } else {
                System.out.println("恭喜你猜对了！");
                break;
            }
            if(i==9){
                System.out.println("猜错10次，你太笨了，下次再来吧！");
                break;
            }
        }
        s.close();

    }
}